obj-m += io-emulator.o

io-emulator-objs += io_emulator.o       \
                    mod_detector.o      \
                    trap_io.o           \
                    decode-a64.o        \
                    error-inject.o

#KERNELDIR := /home/lingyun/Workspace/linux-qemu/out-mainline/linux
#CROSS_COMPILE=aarch64-linux-gnu-

#KERNELDIR := /home/cambricon/Workspace/linux-qemu/out/linux
#CROSS_COMPILE=aarch64-linux-

KERNELDIR := /home/lingyun/misc/monitor/linux-5.x
CROSS_COMPILE=aarch64-linux-

PWD := $(shell pwd)
all:
	ARCH=arm64 CROSS_COMPILE=$(CROSS_COMPILE) $(MAKE) -C $(KERNELDIR) M=$(PWD) modules

clean:
	rm -rf *.ko *.mod* *.o modules.* Module.symvers
